package fr.esgi.utils;

import java.util.regex.Pattern;

public class Utils {
	
	private static final String EMAIL_PATTERN = 
			"^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
			+ "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
	
	public boolean checkSize(String s){
		if(s.length()<3||s.length()>1024){
			return false ;
		}
		else return true;
	}
	public boolean checkNom(String s){
		return s.matches("[a-zA-Z\\s']+");
	}

	public  boolean checkMail(String s){
		return s.matches(EMAIL_PATTERN);
	}
	public boolean verificationPromotion(String s){
	    return s.matches("[a-zA-Z0-9]*");
	}
}
